import { RoutesRule } from "uni-simple-router";

const homePage: RoutesRule = {
  path: "/",
  name: "Home",
  component: () => import(/* webpackChunkName: "home" */ "@/pages/index.vue"),
  meta: { title: "首页", icon: "md-home", affix: true },
};

/** 登陆页路由 */
const loginPage: RoutesRule = {
  path: "/login",
  name: "Login",
  // route level code-splitting
  // this generates a separate chunk (login.[hash].js) for this route
  // which is lazy-loaded when the route is visited.
  component: () => import(/* webpackChunkName: "login" */ "@/pages/login.vue"),
  meta: { title: "登陆", hidden: true },
};


/** 404 页面不存在 */
const error404: RoutesRule = {
  path: '*',
  name: 'Page404',
  component: () => import(/* webpackChunkName: "errpage" */ "@/pages/error/page404.vue"),
  meta: { title: '页面不存在' }
};

/** 系统默认路由配置 */
export const routes = [
  homePage, loginPage, error404
  // {
  //   path: '/',
  //   name: 'root',
  //   component: () => import(/* webpackChunkName: "redirect" */ '@/pages/index.vue'),
  //   meta: { title: '首页', icon: 'md-home', affix: true }
  // },
  // {
  //   path: "*",
  //   name: 'page404',
  //   component: () => import(/* webpackChunkName: "redirect" */ '@/pages/error/page404.vue'),
  //   meta: { title: '页面不存在' }
  // },
];
